package com.xh.bussiness.system.service;



import com.xh.bussiness.system.bean.dto.DictionaryBean;
import com.xh.bussiness.system.bean.request.DictionaryRequest;
import com.xh.bussiness.system.model.Dictionary;
import com.xh.core.service.IBaseService;
import com.xh.core.bean.XhPage;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 数据字典表 服务类
 *
 *
 *
 *
 * </p>
 *
 * @author daiwei
 * @since 2018-10-10
 */
public interface IDictionaryService extends IBaseService<Dictionary> {

    /**
     * 分页查询方法
     * @param page
     * @param bean
     * @return
     */
    public XhPage queryDictionaryPage(XhPage page, DictionaryRequest bean);

    /**
     * 查询方法
     * @param bean
     * @return
     */
    public List queryDictionary(DictionaryRequest bean);
    /**
     * 查询子节点
     * @param parentType
     * @param parentCode
     * @param childType
     * @return
     */
	public List<Dictionary> queryChilds(String parentType, String parentCode, String childType);

	public Map<String, List<Dictionary>> querySubject() throws Exception;
	
	public List<Dictionary> queryGrade() throws Exception;

	public List<Dictionary> initSubject() throws Exception;

	public List<Dictionary> initGrade() throws Exception;

	public List<Dictionary> queryGradeRange();

	void saveObj(DictionaryBean dictionaryBean);

	void modifyObj(DictionaryBean dictionaryBean);

	public List<DictionaryBean> queryGradeAndSubject();

	List<DictionaryBean> queryDataByType(String rangeCode,String typeCode);

	void batchChangeStatus(String[] ids, Integer status);

	public Dictionary queryGradeRangeBySubjectCode(String subjectCode);

	public List<Dictionary> queryDictByTypeCodes(List<String> typeCodes);

	public List<Dictionary> queryDictByCodes(List<String> codes);

	Dictionary queryByCode(String code,String typeCode);

	List<Dictionary> queryDicByIds(List<String> ids);

	XhPage<Map<String,Object>> querySubjectPage(XhPage page, String subjectName, String gradeRangeCode);

	List<Dictionary> queryByName(String typeCode, String name);

	Dictionary queryFirstByName(String typeCode, String name);

	Map<String, List<Dictionary>> queryDictByTypeCodesToMap(List<String> typeCodes);

	Dictionary queryByTypeAndCode(String typeCode, String subjectId);

	List<Dictionary> queryByTypeCode(String typeCode);
}
